package lobby.exchangeddata
{
	/**
	 * ...
	 * @author Doan Nguyen Thuy Nha Truc (Bamboo)
	 */
	import lobby.constants.ConstData;
	
	public class HistoryInfoBaccarat extends HistoryInfoBase
	{
		
		public function HistoryInfoBaccarat()
		{
		
		}
		
		/**
		 * @author Bamboo
		 * @param	result : value that return by fms
		 * @return array history
		 */
		public override function returnSetHistory(result:String):Array
		{
			
			super.setOdlResult = result;
			
			var resultArr:Array = new Array();
			
			var numberHistory:int = int(result.substr(ConstData.POS_HIS_RESULT, ConstData.LEN_NUM_HIS));
			var resultStr:String = result.substr((ConstData.POS_HIS_RESULT + ConstData.LEN_NUM_HIS), (ConstData.LEN_VALUE_HIS * numberHistory));
			
			while (resultStr.length >= 2)
			{
				resultArr.push(resultStr.slice(0, 2));
				resultStr = resultStr.slice(2, resultStr.length);
			}
			
			return resultArr;
		}
	
		public override function init(casinoid:String, casinoName:String, gameType:String, tableId:String, tableName:String, tableClose:Boolean):void
		{
			super.init(casinoid, casinoName, gameType, tableId, tableName, tableClose);
			if (gameType == "Ba")
			{
				gameTypeIndex = 1;
			}
			else if (gameType == "Bi")
			{
				gameTypeIndex = 2;
			}
		}
	}

}